const config = require('../config');
const pathLib = require('path');

const env = process.env.NODE_ENV || 'development';

const log4js = require('log4js');
log4js.configure({
    appenders: { cheese: { type: 'file', filename: pathLib.join(config.log_dir, 'cheese.log') } },
    categories: { default: { appenders: ['cheese'], level: 'error' } }
});

// log4js.configure({
//     appenders: [
//         { type: 'console' },
//         { type: 'file', filename: pathLib.join(config.log_dir, 'cheese.log'), category: 'cheese' }
//     ]
// });

const logger = log4js.getLogger('cheese');
// logger.setLevel(config.debug && env !== 'test' ? 'DEBUG' : 'ERRPR')
logger.debug('Got cheese.');
module.exports = logger;